#!/usr/bin/evn python3
#-*- coding: utf-8 -*-

#__getattr__类似于php中的_call方法
#python中的对象和方法没有特别清晰的界限
class Test:
	def __init__(self, name):
		self.name = name

	def __getattr__(self, attr):
		if attr == 'age':
			return 22
		elif attr == 'sex':
			return lambda: 1

	def __call__(self, param):
		print('call ' + param)

test = Test('wowo')
print(test.age)
print(test.sex())
test('here')
